from django.urls import path
from . import views

app_name = 'stories'

urlpatterns = [
    # 故事生成
    path('generate', views.generate_story, name='generate_story'),
    
    # 故事列表和详情
    path('', views.story_list, name='story_list'),
    path('<int:story_id>', views.story_detail, name='story_detail'),
    
    # 故事CRUD
    path('create', views.create_story, name='create_story'),
    path('<int:story_id>/update', views.update_story, name='update_story'),
    path('<int:story_id>/publish', views.publish_story, name='publish_story'),
    path('<int:story_id>/delete', views.delete_story, name='delete_story'),
    
    # 审核操作
    path('<int:story_id>/approve', views.approve_story, name='approve_story'),
    path('<int:story_id>/reject', views.reject_story, name='reject_story'),
    
    # 其他
    path('top', views.get_top_stories, name='top_stories'),
    path('categories', views.get_categories, name='categories'),
    path('user/<int:user_id>', views.get_user_stories, name='user_stories'),
    
    # 数据分析
    path('analytics', views.get_analytics, name='analytics'),
]
